home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
games
/
389
/
styzor
/
styzor.lst
< prev
next >
Wrap
File List
|
1985-11-19
|
16KB
|
570 lines
' ***********************************************
' ** STYZOR'S CONTEST **
' ** by Greg Kowis **
' ** **
' ** (c) Copyright 1990 by **
' ** Antic Publishing, Inc. **
' ** **
' ** a GFA BASIC game **
' ** **
' ***********************************************
' #################################################
' ### ###
' ### This program will run on both mono and ###
' ### color systems. ###
' ### ###
' #################################################
' **************************************************
' ****** MAIN LINE 000 ******
' **************************************************
Rez%=Xbios(4)
If Rez%=1 Then
Alert 3,"Styzor's Contest runs in|high or low resolution only",1," Cancel ",Dummy
Edit
Endif
High%=0
Low%=(Rez%=0)
Mono%=(Rez%=2)
Gosub Save_pal
Dim D_rect%(5,1),Targ_pos%(5,1),Hit%(5),Cir$(5,5),Scor%(11),Hi_name$(11)
Openw 0
Openw 0,0,0
On Break Gosub Break_out
Rerun%=False
Path$=Dir$(0)+"\"
Fil$=Path$+"STYZOR.DAT"
If Exist(Fil$) Then
Open "I",#1,Fil$
I%=1
While Not Eof(#1)
Input #1,Scor%(I%),Hi_name$(I%)
Inc I%
Wend
Close #1
High%=Scor%(1)
Endif
Gosub Col_set
Deffill 1-6*Low%
Pbox 0,0,639+320*Low%,199-200*Mono%
Deffill 0
Pbox 280+140*Low%,0,360+180*Low%,199-200*Mono%
Deffill 1
Mouse$=Mki$(7)+Mki$(7)
Mouse$=Mouse$+Mki$(0)
Mouse$=Mouse$+Mki$(3)
Mouse$=Mouse$+Mki$(1)
For I%=1 To 16
Read Backgrnd
Mouse$=Mouse$+Mki$(Backgrnd)
Next I%
For I%=1 To 16
Read Foregrnd
Mouse$=Mouse$+Mki$(Foregrnd)
Next I%
For I%=1 To 5
Pcircle 320+160*Low%,50+I%*(20-20*Mono%),I%*(4+2*Low%)
Next I%
For I%=1 To 5
Col%=2-(I%-1)*Low%+((Not (Low%))*Odd(I%))
Deffill Col%
Deftext Col%,0,0,6
Text 25,0,"(c) Copyright 1990 by Antic Publishing"
For J%=1 To 5
Deftext Col%,16,,6+J%-7*Mono%
Fill 320+160*Low%,50+J%*(20-20*Mono%)
Rx%=J%*(4+2*Low%)
Ry%=J%*(2-2*Mono%)
H%=320+160*Low%
V%=(20-20*Mono%)*J%
Get H%-Rx%,V%-Ry%+50,H%+Rx%,V%+Ry%+50,Cir$(I%,6-J%)
Sound 1,13,I%,J%
Text 15+10*Low%,(23-22*Mono%)*J%-J%*2+50,"STYZOR'S"
Text 538+310*Low%-J%*6,(23-22*Mono%)*J%-J%*2+50,"CONTEST"
Pause 5
Next J%
Next I%
Deftext 1,1,,6-7*Mono%
Sound 1,0,0,0
While Not Quit%
Deffill 0
Graphmode 1
Pbox 0,0,639+320*Low%,199-200*Mono%
Color 1
For I%=1 To 30
X%=Random(640+319*Low%)
Y%=20+Random(179-200*Mono%)
Plot X%,Y%
Next I%
Rbox 610+320*Low%,185-195*Mono%,636+320*Low%,199-200*Mono%
Graphmode 3
Ot%=0
Score%=0
Level%=1
Wave%=0
Text 1,17-17*Mono%," Score "+Str$(Score%)
Text 254+142*Low%,17-17*Mono%," High "+Str$(High%)
Text 478+259*Low%,17-17*Mono%," Level "+Str$(Level%)
Terminate%=0
Defmouse Mouse$
Collide%=0
While Not Terminate%
Text 478+259*Low%,17-17*Mono%," Level "+Str$(Level%)
Level%=Level%-(Wave%=5)
Text 478+259*Low%,17-17*Mono%," Level "+Str$(Level%)
T_i_m_e%=Timer
Seconds%=90-5*Level%
Oseconds%=Seconds%
Sec%=Seconds%
Speed%=Level%+2+Rez%
Wave%=Wave%+1
If Wave%=6 Then
Wave%=1
Endif
Text 615+320*Low%,195-200*Mono%,Oseconds%
Gosub Place_them
K%=0
While (Hit%(1)+Hit%(2)+Hit%(3)+Hit%(4)+Hit%(5))<>-5 And Seconds%>0
Gosub Move_them
Ok%=K%
U$=Inkey$
If U$=" " Then
Tm%=Timer-T_i_m_e%
U$=""
Hidem
While U$<>" "
U$=Inkey$
Wend
Showm
T_i_m_e%=Timer-Tm%
Endif
Mouse X%,Y%,K%
If (K%=1 And Ok%<>1) Or K%=2 Then
If K%=2 Then
Text 1,17-17*Mono%," Score "+Str$(Score%)
Text 254+142*Low%,17-17*Mono%," High "+Str$(High%)
Score%=Score%-20*Level%
Text 1,17-17*Mono%," Score "+Str$(Score%)
Text 254+142*Low%,17-17*Mono%," High "+Str$(High%)
Endif
Vsync
Line 320+160*Low%,199-200*Mono%,X%,Y%
Gosub Hit_one
Vsync
Line 320+160*Low%,199-200*Mono%,X%,Y%
If Collide% Then
Sound 1,13,10,1,0
Wave 25,3,9,5200,5
Else
Sound 1,15,9,4,0
Wave 25,3,14,50,4
Wave 0,0
Endif
Endif
Seconds%=Sec%-((Timer-T_i_m_e%)\200)
If Seconds%<>Oseconds% Then
Text 615+320*Low%,195-200*Mono%,Oseconds%
Text 615+320*Low%,195-200*Mono%,Seconds%
Oseconds%=Seconds%
Sound 1,0,4,7,0
Wave 1,1,15,60,0
Endif
Wend
Text 615+320*Low%,195-200*Mono%,Oseconds%
If Seconds%<=0 Then
Terminate%=-1
Endif
Wend
Graphmode 1
Gosub Hi_scr_in
If Not Rerun% Then
Gosub Scores_n_exit
Endif
Graphmode 3
Wend
Open "O",#1,Fil$
I%=1
While I%<11 And Scor%(I%)<>0
Write #1,Scor%(I%),Hi_name$(I%)
Inc I%
Wend
Close #1
Sound 0,0,0,0,0
Sound 1,0,0,0,0
Sound 2,0,0,0,0
Wave 7,0
Gosub Restore_pal
Edit
End
' **************************************************
' ****** BREAK KEY ANSWER 110 ******
' **************************************************
Procedure Break_out
Terminate%=-1
Sec%=0
Return
' **************************************************
' ****** TEST FOR COLLISION 120 ******
' **************************************************
Procedure Hit_one
Collide%=0
For I%=1 To 5
If Not Hit%(I%) Then
Cx%=Targ_pos%(I%,0)
Cy%=Targ_pos%(I%,1)
Spd%=Speed%\2
If X%>=Cx%-Spd% And X%=<Cx%+(8+4*Low%)*(6-Wave%)+Spd% And Y%>=Cy%-Spd% And Y%=<Cy%+4*(6-6*Mono%-Wave%)+Spd% Then
Text 1,17-17*Mono%," Score "+Str$(Score%)
Text 254+142*Low%,17-17*Mono%," High "+Str$(High%)
Collide%=-1
Hit%(I%)=-1
Vsync
Put Targ_pos%(I%,0),Targ_pos%(I%,1),Cir$(I%,Wave%),6
Score%=Score%+4*(Wave%+Level%*Level%)
If Score%>High% Then
High%=Score%
Endif
Text 1,17-17*Mono%," Score "+Str$(Score%)
Text 254+142*Low%,17-17*Mono%," High "+Str$(High%)
Endif
Endif
Next I%
Return
' **************************************************
' ****** ADD HIGH SCORES TO LIST 130 ******
' **************************************************
Procedure Hi_scr_in
T%=1
B%=10
If Score%>Scor%(B%) Then
Collide%=0
Gosub Give_name
While Not Collide%
M%=(T%+B%)\2
If Scor%(M%)<Score% Then
B%=M%-1
Else
T%=M%+1
Endif
If B%<T% Then
Collide%=True
Endif
Wend
Temp_sc%=Score%
For I%=T% To 10
Swap Temp_sc%,Scor%(I%)
Swap Name$,Hi_name$(I%)
Next I%
If T%<>1 Then
Chance_num%=Random(3)
If (Not Rerun%) And Chance_num%=1 Then
Oscore%=Score%
Deftext 1,0,0,6-7*Mono%
Pbox 0,0,639+320*Low%,199-200*Mono%
Text 176+164*Low%,30-30*Mono%," I am feeling especially generous"
Text 176+164*Low%,50-50*Mono%,"at the moment, so I will give you a"
Text 176+164*Low%,70-70*Mono%,"second chance, and this time you only"
Text 176+164*Low%,90-90*Mono%,"have to beat your last score. Do you"
Text 176+164*Low%,110-110*Mono%,"accept my offer or will you bow to the"
Text 176+164*Low%,130-130*Mono%,"inevitable?"
Box 160+80*Low%,160-200*Mono%,264+120*Low%,180-200*Mono%
Box 400+200*Low%,160-200*Mono%,504+240*Low%,180-200*Mono%
Text 201+101*Low%,173-200*Mono%,"Try"
Text 425+221*Low%,173-200*Mono%,"Give Up"
Deftext 1,1,0,6-7*Mono%
Click%=False
Rerun%=False
While Not Click%
K%=0
While K%=0
Mouse X%,Y%,K%
Wend
If X%>(160+80*Low%) And X%<(260+120*Low%) And Y%<(180-200*Mono%) And Y%>(160-200*Mono%) Then
Click%=True
Rerun%=True
Else
If X%>(400+200*Low%) And X%<(500+240*Low%) And Y%<(180-200*Mono%) And Y%>(160-200*Mono%) Then
Click%=True
Endif
Endif
Wend
Else
If Score%>Oscore% Then
@Made_it
Else
@Failed
Endif
Oscore%=Scor%(1)
Rerun%=False
Endif
Else
@Made_it
Rerun%=False
Endif
Else
@Failed
Rerun%=False
Endif
Return
' **************************************************
' ****** DISPLAY SCORES AND OFFER EXIT 140 ******
' **************************************************
Procedure Scores_n_exit
Pbox 0,0,639+320*Low%,199-200*Mono%
I%=1
Deftext 3,0,0,23-7*Mono%
Text 154+156*Low%,30-30*Mono%,"«««Styzor's Contest»»»"
Deftext 3,0,0,6
Text 154+156*Low%,40-40*Mono%,"(c) 1990 by Antic Publishing"
Deftext 2,4,0,6-7*Mono%
While I%<11 And Scor%(I%)<>0
Text 203+160*Low%,45-45*Mono%+(10-10*Mono%)*I%,Hi_name$(I%)
Text 383+152*Low%,45-45*Mono%+(10-10*Mono%)*I%,Str$(Scor%(I%))
Inc I%
Wend
Box 160+80*Low%,160-190*Mono%,240+120*Low%,180-200*Mono%
Box 400+200*Low%,160-190*Mono%,480+240*Low%,180-200*Mono%
Deftext 1,1,0,13-7*Mono%
Text 185+101*Low%+10*Mono%,175-200*Mono%,"Play"
Text 425+221*Low%+10*Mono%,175-200*Mono%,"Quit"
Deftext 1,1,0,6-7*Mono%
Text 1,196-200*Mono%," Score "+Str$(Score%)
Text 254+142*Low%,196-200*Mono%," High "+Str$(High%)
Text 478+259*Low%,196-200*Mono%," Level "+Str$(Level%)
Defmouse 0
Click%=False
While Not Click%
K%=0
While K%=0
Mouse X%,Y%,K%
Wend
If X%>(160+80*Low%) And X%<(240+120*Low%) And Y%<(180-190*Mono%) And Y%>(160-190*Mono%) Then
Click%=True
Else
If X%>(400+200*Low%) And X%<(480+240*Low%) And Y%<(180-190*Mono%) And Y%>(160-190*Mono%) Then
Click%=True
Quit%=True
Endif
Endif
Wend
Return
' **************************************************
' ****** GIVE NAME FOR TOP 10 SCORE 210 ******
' **************************************************
Procedure Give_name
Pbox 0,0,639+320*Low%,199-200*Mono%
Text 1,17-17*Mono%," Score "+Str$(Score%)
Text 254+142*Low%,17-17*Mono%," High "+Str$(High%)
Text 478+259*Low%,17-17*Mono%," Level "+Str$(Level%)
Color 1
For I%=1 To 30
X%=Random(640+319*Low%)
Y%=20+Random(179-200*Mono%)
Plot X%,Y%
Next I%
Wave%=1
Speed%=27+Rez%
Gosub Place_them
For K%=1 To 30
Sound 1,13,Random(13),Random(9),1
Gosub Move_them
Next K%
For K%=1 To 10
For I%=0 To (3-Low%)
Setcolor I%,Random(8),Random(8),Random(8)
Sound 1,15,8,6,0
Sound 2,15,8,6
Wave 3,3,14,10,2
Next I%
Next K%
Wave 0,0
Sound 1,0,0,0,0
Sound 2,0,0,0
Sound 3,0,0,0
Wave 7,0
Gosub Col_set
Hidem
Deftext 1,0,0,13-7*Mono%
Text 224+161*Low%+100*Mono%,90-90*Mono%,"You've made the top 10!!!"
Text 176+164*Low%+100*Mono%,110-110*Mono%,"Enter your name into the Hall of Fame."
Print At(34+22*Low%+10*Mono%,14-14*Mono%);
Form Input 15,Name$
Showm
Return
' **************************************************
' ****** SHOW MADE IT MESSAGE 220 ******
' **************************************************
Procedure Made_it
Pbox 0,0,639+320*Low%,199-200*Mono%
Deftext ,,,6-10*Mono%
If Low% Then
Setcolor 15,0,0,0
Else
Setcolor 3,0,0,0
Endif
Text 216+164*Low%,80,"Regretfully! You have met my"
Text 216+164*Low%,100,"requirements, so I will allow"
Text 216+164*Low%,120,"you to live."
For I%=0 To 7
Pause 10
If Low% Then
Setcolor 15,I%,I%,I%
Else
Setcolor 3,I%,I%,I%
Endif
Next I%
Pause 30
For I%=7 Downto 0
Pause 10
If Low% Then
Setcolor 15,I%,I%,I%
Else
Setcolor 3,I%,I%,I%
Endif
Next I%
Pbox 0,0,639+320*Low%,199-200*Mono%
If Low% Then
Setcolor 15,7,7,7
Else
Setcolor 3,7,7,7
Endif
Return
' **************************************************
' ****** SHOW FAILED MESSAGE 230 ******
' **************************************************
Procedure Failed
Pbox 0,0,639+320*Low%,199-200*Mono%
Deftext ,,,6-10*Mono%
If Low% Then
Setcolor 15,0,0,0
Else
Setcolor 3,0,0,0
Endif
Text 216+164*Low%,80,"Tisk Tisk, you have failed"
Text 216+164*Low%,100,"to meet my standards, so"
Text 216+164*Low%,120,"your life is forfeit."
For I%=0 To 7
Pause 10
If Low% Then
Setcolor 15,I%,I%,I%
Else
Setcolor 3,I%,I%,I%
Endif
Next I%
Pause 30
For I%=7 Downto 0
Pause 10
If Low% Then
Setcolor 15,I%,I%,I%
Else
Setcolor 3,I%,I%,I%
Endif
Next I%
Pbox 0,0,639+320*Low%,199-200*Mono%
If Low% Then
Setcolor 15,7,7,7
Else
Setcolor 3,7,7,7
Endif
Return
' **************************************************
' ****** PLACE THE TARGETS 310 ******
' **************************************************
Procedure Place_them
Hidem
For I%=1 To 5
Hit%(I%)=0
For J%=0 To 1
R%=Int(Rnd+0.5)
If R%=0 Then
R%=-1
Endif
D_rect%(I%,J%)=R%
Next J%
Targ_pos%(I%,0)=Int(Random(639+320*Low%-(8+4*Low%)*(6-Wave%)))
Targ_pos%(I%,1)=10+Int(Random((189-200*Mono%)-4*(6-Wave%)))
Put Targ_pos%(I%,0),Targ_pos%(I%,1),Cir$(I%,Wave%),6
Next I%
Showm
Return
' **************************************************
' ****** MOVE THE TARGETS 320 ******
' **************************************************
Procedure Move_them
For I%=1 To 5
If Not Hit%(I%) Then
Vsync
Put Targ_pos%(I%,0),Targ_pos%(I%,1),Cir$(I%,Wave%),6
Tmx%=Speed%*D_rect%(I%,0)
Tmy%=Speed%*D_rect%(I%,1)
If (Targ_pos%(I%,0)+Tmx%)<0 Or (Targ_pos%(I%,0)+Tmx%+(6-Wave%)*(8+4*Low%))>(639+320*Low%) Then
D_rect%(I%,0)=-D_rect%(I%,0)
Endif
If (Targ_pos%(I%,1)+Tmy%)<9 Or (Targ_pos%(I%,1)+Tmy%+(6-Wave%)*4)>(198-200*Mono%) Then
D_rect%(I%,1)=-D_rect%(I%,1)
Endif
Targ_pos%(I%,0)=Targ_pos%(I%,0)+Speed%*D_rect%(I%,0)
Targ_pos%(I%,1)=Targ_pos%(I%,1)+Speed%*D_rect%(I%,1)
Vsync
Put Targ_pos%(I%,0),Targ_pos%(I%,1),Cir$(I%,Wave%),6
Endif
Next I%
Return
' **************************************************
' ****** SET GAME COLORS 330 ******
' **************************************************
Procedure Col_set
Setcolor 0,0,0,0
If Low% Then
Setcolor 15,7,7,7
Setcolor 1,7,0,0
Setcolor 2,0,7,0
Setcolor 4,0,0,7
Setcolor 6,7,7,0
Setcolor 3,7,0,7
Else
Setcolor 3,7,7,7
Setcolor 1,7,0,0
Setcolor 2,0,7,0
Endif
Return
' **************************************************
' ****** MOUSE DATA ******
' **************************************************
Data 0,0,0,4112,2080,1728,1728,0,1728,1728,2080,4112,0,0,0,0
Data 896,2336,8456,256,16644,256,33026,65278,33026,256,16644,256,8456,2336,896,0
'
' ------------- SAVE ORIGINAL COLOR PALETTE -----------------------
Procedure Save_pal
'
Dim Spalette%(16,3)
'
For Z%=0 To 15
Dpoke Contrl,26
Dpoke Contrl+2,0
Dpoke Contrl+6,2
Dpoke Intin,Z%
Dpoke Intin+2,0
Vdisys
Spalette%(Z%,0)=Dpeek(Intout+2)
Spalette%(Z%,1)=Dpeek(Intout+4)
Spalette%(Z%,2)=Dpeek(Intout+6)
Next Z%
Return
'
' --------------------- RESTORES PALETTE -------------------
Procedure Restore_pal
' Dimensions: Spalette%(16,3)
'
For Z%=0 To 15
Dpoke Contrl,14
Dpoke Contrl+2,0
Dpoke Contrl+6,4
Dpoke Intin,Z%
Dpoke Intin+2,Spalette%(Z%,0)
Dpoke Intin+4,Spalette%(Z%,1)
Dpoke Intin+6,Spalette%(Z%,2)
Vdisys
Next Z%
Return
'